/*
 * @Description: 
 * @Author: Wen
 * @Date: 2024-12-04 10:34:05
 * @LastEditors: Wen
 * @LastEditTime: 2024-12-04 10:52:34
 * 太棒了，又坚持了一天
 */
package com.briup.web;

import com.briup.pojo.Book;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/books")
public class BookController {
    //映射配置
    //127.0.0.1:8080/getById/1
    @RequestMapping(value="getById/{id}",method = RequestMethod.GET)
    @GetMapping("/getById/{id}")
    public Book getById(@PathVariable Integer id){
        System.out.println("getById:"+id);
        Book book = new Book();
        book.setId(id);
        book.setName("java核心讲义");
        return book;
    }
    @GetMapping("/detBlId/{id}")
    public String delById(@PathVariable Integer id){
        System.out.println("delById:"+id);
        // Book book = new Book();
        // book.setId(id);
        // book.setName("java核心讲义");
        return "book" +id+ "删除成功";
    }
}
